package cheme.ProcessModel.Interpreter.Parsers;

import syntaxtree.Node;
import visitor.GJNoArguVisitor;
import visitor.GJVisitor;
import visitor.GJVoidVisitor;
import visitor.Visitor;

public class DummyParser extends AbstractParser
{
	private static DummyParser instance = null;
	
	private DummyParser()
	{
	}
	
	public static DummyParser getInstance()
	{
		if(null == instance)
		{
			instance = new DummyParser();
		}
		
		return instance;
	}
	
	public boolean syntaxIsValid(String text)
	{
		return true;
	}
	
	public String getMessage()
	{
		return "";
	}

	@Override
	protected Node internalParse()
	{
		return dummyNode;
	}
	
	public static final Node dummyNode = new Node()
	{
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public void accept(Visitor v)
		{
		}

		public <R, A> R accept(GJVisitor<R, A> v, A argu)
		{
			return null;
		}

		public <R> R accept(GJNoArguVisitor<R> v)
		{
			return null;
		}

		public <A> void accept(GJVoidVisitor<A> v, A argu)
		{
		}
	};
}
